﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Ordinapoche.WinForms;
using Ordinapoche.Core;

namespace Ordinapoche
{
    public partial class MainForm : Form
    {
        Memory _Memory;
        Processor _Core1;
        Processor _Core2;

        public MainForm ()
        {
            InitializeComponent ();
        }

        private void Form1_Load (object sender, EventArgs e)
        {
            _Memory = new Memory ();
            _Core1 = new Processor (_Memory);
            _Core2 = new Processor (_Memory);

            memory_Control.Memory = _Memory;
            processor_Core1.Processor = _Core1;
            processor_Core2.Processor = _Core2;

            _Memory[1] = Instruction.Cla (5);   
            _Memory[2] = Instruction.Add (6);   
            _Memory[3] = Instruction.Sto (6);
            _Memory[4] = Instruction.Jmp (1);
            _Memory[5] = 1;
            _Memory[6] = 2;

            _Core1.Startup ();
            _Core2.Startup ();
        }
    }
}
